package CTRLayer;
import ModelLayer.*;


/**
 * A class to control the creation and management of corporate customers
 * 
 * @author Mike M. Madsen, Rasmus A. Borup
 * @version 15/12-2013
 */
public class CorporateCustomerCtr
{
    // Instance Variables
    private CorporateCustomerContainer cCCont;
    
    /**
     * Constuctor for objects of class CorporateCustomerCtr
     */
    public CorporateCustomerCtr()
    {
        cCCont = CorporateCustomerContainer.getInstance();
    }

    /**
     * Returns a corporateCustomer from the corporateCustomer container found by customer id
     */
    public CorporateCustomer getCorporateCustomer(String id)
    {
        return cCCont.getCorporateCustomerByID(id);
    }
   
    /**
     * Creates a new corporateCustomer using the createCorporateCustomer method and adding it to the corporateCustomer container
     */
    public void addCorporateCustomer(String name, String email, String address, String phoneNO,
                                     String zipCode, String city, String accountNO, boolean vatRegistered)
    {
        cCCont.addCustomer(createCorporateCustomer(name, email, address, phoneNO, zipCode, city, accountNO, vatRegistered));
    }
    
    /**
     * Returns a newly made corporateCustomer object
     */
    private CorporateCustomer createCorporateCustomer(String name, String email, String address, String phoneNO,
                                                      String zipCode, String city, String accountNO, boolean vatRegistered)
    {
        return new CorporateCustomer(name, email, address, phoneNO, zipCode, city, accountNO, vatRegistered);
    }
    
    
}

